#include <string.h>
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>

using namespace std;

class Singleton{
public:

    static Singleton* getInstance(){
        if(_s==nullptr){
            _s=new Singleton();
        }
        return _s;
    }

    static void destroy(){
        if(_s)
            delete _s;
    }

private:
    Singleton(){}
    Singleton(const Singleton&)=delete;
    Singleton& operator=(const Singleton &)=delete;
    ~Singleton(){}

    static Singleton *_s;
};
Singleton* Singleton::_s;

void test(){

    Singleton::getInstance();
    Singleton::destroy();
}

int main()
{
 test();
 return 0;
}

